<!--
	作者：956911785@qq.com
	时间：2018-10-18
	描述：审核
-->

<template>
	<Modal title="审核" v-model="modal0" width="500px">
		<Form :label-width="100" label-position="left">
			<div style="width:100%;height: 250px; overflow-y: scroll;">
		       <div style="width:100%;height: auto;overflow: hidden;float:left;">
				    <div class="demo-upload-list" v-for="item in photos">
			            <img :src="item.imageurl">
			            <div class="demo-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item.imageurl)"></Icon>
			            </div>
				    </div>
				    <Modal title="浏览图片" v-model="visible">
				        <img :src="imgurl" v-if="visible" style="width: 100%">
				    </Modal>
			    </div> 
			    
		        <div style="width:100%;height: auto;float:left;">
		        	<FormItem label="其它说明:">
		        		<template v-if="params.bmqksm">
		        			<P>{{params.bmqksm}}</P>
		        		</template>
		        		<template v-else>
		        			<P>无</P>
		        		</template>
			        	
        			</FormItem>
		        </div>
		        <div style="width:100%;height: auto;float:left;">
		        	<FormItem label="审核">
			        	<Select v-model="shqk" style="width:200px">
					        <Option value="1" >审核通过</Option>
					        <Option value="2" >审核未通过</Option>
					    </Select>
        			</FormItem>
		        </div>
		   </div> 
	    </Form>
	   	<div slot="footer">
	    	<Button type="text"  @click="closeModal()">取消</Button>
	    	<Button type="primary" @click="shenhe()" >确定</Button>
	    </div>
     </Modal>
</template>

<script>
	import _config from "../../../../../../config/config"
	export default {
		name:"shenhe",
		props: {
    		shparams:{
    			type:Object,	
    			default: function() {
					return null
				}
    		},
    	},
		data() {
			return {
                imgurl: '',
                visible: false,
                modal0:false,
                photos:[],
                params:{},
                shqk:'',
			}
		},
		components: {
		},
		methods: {
			shenhe:function(){
				if(this.shqk==""){
					this.$Modal.error({
                        title: "失败",
                        content: "请选择审核情况！"
                    });
                    return;
				}
				const params={
					bid:this.params.bid,
					shqk:this.shqk
				};
				this.$emit("sureShqk",params);   
	        }, 
			
			
            closeModal(){
	      	    this.modal0 = false;
	      	    this.resetpar();
	        },
	        resetpar(){
	        	this.params={
	        		bid:"",
	        		sid:"",
                	sname:"",
                	sfzh:"",
                	cyear:"",
                	bmqksm:"",
                	bmzl:[]
				};
	        	this.photos=[];
	        	this.imgurl="";
	        },
	        
	        
			handleView (imageurl) {
                this.visible = true;
                this.imgurl=imageurl;
            },
	        
		},
		mounted() {

		},
		watch:{
			modal0(news,olds){
				if(!news){
					 this.resetpar();
				}else{
					const shparams=this.shparams;
					const imgarr=shparams.bmzl;
					var photos=[];
					for(var i=0;i<imgarr.length;i++){
						const img={
							imageurl:_config._ADMIN_SERVER+"/stgl/"+imgarr[i].url,
							url:imgarr[i].url,
						};
						photos.push(img);
					}  	
					this.photos=photos;
					this.params=shparams;
				}
			}
		},
		computed: {
			
		}
		
	}
</script>

<style scoped="scoped">
	 .demo-upload-list{
        display: inline-block;
        width: 100px;
        height: auto;
        text-align: center;
        line-height: 60px;
        border: 1px solid transparent;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
        position: relative;
        box-shadow: 0px;
        margin-right: 4px;
        float:left;
        margin-left: 4px;
    }
    .demo-upload-list img{
        width: 100%;
        height: 100%;
    }
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .demo-upload-list:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
</style>



